<?php

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

/**
 * HTML View class for the HelloWorld Component
 */
class BGViewUser extends JView
{
	// Overwriting JView display method
	function display($tpl = null) 
	{
        switch(JRequest::getVar('task')){
            case 'edit':
                JToolBarHelper::title( 'ユーザー変更', 'user.png' );
                JToolBarHelper::save('save','登録');
            	JToolBarHelper::cancel('cancel', 'キャンセル');
                $this->setLayout('add');
                break;
                
            case 'add':
            	JToolBarHelper::title( 'ユーザー登録', 'user.png' );
                JToolBarHelper::save('save','登録');
            	JToolBarHelper::cancel('cancel', 'キャンセル');
                $this->setLayout('add');
            	break;
            	    
            default :
            	JToolBarHelper::title( 'ユーザー（一覧）管理', 'user.png' );
                JToolBarHelper::addNew('add','作成');
            	JToolBarHelper::editList('edit', '編集');
            	JToolBarHelper::deleteList('', 'remove','削除');
		}
        
		parent::display();
	}
}
